package cn.kgm.bio.chat.server;

import cn.kgm.bio.chat.common.Constants;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.HashMap;

public class ServerChat {

    public static final HashMap<Socket, String> onLineSocket = new HashMap<>();

    public static void main(String[] args) throws IOException {
        try {
            ServerSocket serverSocket = new ServerSocket(Constants.PORT);
            for (; ; ) {
                Socket socket = serverSocket.accept();
                new ServerReader(socket).start();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
